package deepr.handler;

import deepr.core.DisposeContext;
import deepr.filter.FilterParser;
import deepr.lib.CastLib;

import java.lang.reflect.InvocationTargetException;

public class SnowIdHandler extends PropertyHandler {

    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class<?> handler = SnowIdHandler.class;
//        handler.getMethod("filter",
//                FilterParser.class, String.class, Object.class, Object.class).
//                invoke(handler.newInstance(), new FilterParser(new HandlerContext(SchemaType.NEO4J)), "id", "1", new String[]{"id"});
    }

    @Override
    public Object filter(FilterParser parser, String key, Object value, Object params) {
        return CastLib.toInteger(key, value);
    }

    public Object replyBefore(DisposeContext ctx, String object, String key, Object row) {
        return row;
    }

}
